﻿@model PagedList.IPagedList<Ajax_Learning.Models.Restaurent>
@using PagedList.Mvc;
    <table>
        <tr>
            <th>
                Name
            </th>
            <th>
                Location
            </th>
            <th>
                Country
            </th>
            <th></th>
        </tr>

        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Name)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Location)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Country)
                </td>
                <td>
                    @Html.ActionLink("Edit", "Edit", new { id = item.RestaurentID }) |
                    @Html.ActionLink("Details", "Details", new { id = item.RestaurentID }) |
                    @Html.ActionLink("Delete", "Delete", new { id = item.RestaurentID })
                </td>
            </tr>
        }

    </table>
    Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) of @Model.PageCount
    @Html.PagedListPager(Model, page => Url.Action("Index", "Restaurent", new { page, currentFilter = ViewBag.CurrentFilter }))